package com.baicun.wish.main;

import com.baicun.wish.sink.SinkToCsv;
import com.baicun.wish.sink.SinkToCsv2;
import com.baicun.wish.spiders.CollegeSpider;
import com.baicun.wish.spiders.ProvinceAdmitSpider;

/**
 * @author baicun
 * @description 爬虫测试类
 */
public class Spider {
    public static void main(String[] args) throws Exception {

        //        1.负责爬取 https://gkcx.eol.cn/school/(30-3560) 大学数据

        long begin = System.currentTimeMillis();

        SinkToCsv.create("college(2230-3560).csv");
        SinkToCsv2.create("college_basic(2230-3560).csv");

        for (int i = 2230; i <3560 ; i++) {
             try{
                 CollegeSpider.getCollege(i);
             }catch (Exception e){
                 e.printStackTrace();
             }
         }

        SinkToCsv.close();
        SinkToCsv2.close();

        //        3.负责爬取 https://gkcx.eol.cn/linepro 各省录取分数线

        //        ProvinceAdmitSpider.getScoreLine();

        long end = System.currentTimeMillis();
        System.out.println((double)(end-begin)/1000);
    }
}
